From 84eaf3da7defcd344248c547b3de0c797d224d6c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 13 Dec 2017 23:47:02 -0500 Subject: [PATCH] Drop atom-related cast macros These don't really add anything, just drop them. --- gdk/gdkdevice.c | 2 +- gdk/gdktypes.h | 17 ----------------- gdk/x11/gdkproperty-x11.c | 13 +++++-------- 3 files changed, 6 insertions(+), 26 deletions(-) diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c index 92e6a619b7..eca18dec18 100644 --- a/gdk/gdkdevice.c +++ b/gdk/gdkdevice.c @@ -1236,7 +1236,7 @@ gdk_device_list_axes (GdkDevice *device) GdkAxisInfo axis_info; axis_info = g_array_index (device->axes, GdkAxisInfo, i); - axes = g_list_prepend (axes, GDK_ATOM_TO_POINTER (axis_info.label)); + axes = g_list_prepend (axes, axis_info.label); } return g_list_reverse (axes); diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h index 533bdface7..d77094a2ad 100644 --- a/gdk/gdktypes.h +++ b/gdk/gdktypes.h @@ -102,23 +102,6 @@ typedef cairo_rectangle_int_t GdkRectangle; */ typedef const char *GdkAtom; -/** - * GDK_ATOM_TO_POINTER: - * @atom: a #GdkAtom. - * - * Converts a #GdkAtom into a pointer type. - */ -#define GDK_ATOM_TO_POINTER(atom) ((gpointer) (atom)) - -/** - * GDK_POINTER_TO_ATOM: - * @ptr: a pointer containing a #GdkAtom. - * - * Extracts a #GdkAtom from a pointer. The #GdkAtom must have been - * stored in the pointer with GDK_ATOM_TO_POINTER(). - */ -#define GDK_POINTER_TO_ATOM(ptr) ((GdkAtom)(ptr)) - /* Forward declarations of commonly used types */ typedef struct _GdkRGBA GdkRGBA; typedef struct _GdkContentFormats GdkContentFormats; diff --git a/gdk/x11/gdkproperty-x11.c b/gdk/x11/gdkproperty-x11.c index 646f5e6112..dc3ca81ead 100644 --- a/gdk/x11/gdkproperty-x11.c +++ b/gdk/x11/gdkproperty-x11.c @@ -47,12 +47,10 @@ insert_atom_pair (GdkDisplay *display, display_x11->atom_to_virtual = g_hash_table_new (g_direct_hash, NULL); } - g_hash_table_insert (display_x11->atom_from_virtual, - GDK_ATOM_TO_POINTER (virtual_atom), + g_hash_table_insert (display_x11->atom_from_virtual, (gpointer)virtual_atom, GUINT_TO_POINTER (xatom)); g_hash_table_insert (display_x11->atom_to_virtual, - GUINT_TO_POINTER (xatom), - GDK_ATOM_TO_POINTER (virtual_atom)); + GUINT_TO_POINTER (xatom), (gpointer)virtual_atom); } static Atom @@ -62,8 +60,7 @@ lookup_cached_xatom (GdkDisplay *display, GdkX11Display *display_x11 = GDK_X11_DISPLAY (display); if (display_x11->atom_from_virtual) - return GPOINTER_TO_UINT (g_hash_table_lookup (display_x11->atom_from_virtual, - GDK_ATOM_TO_POINTER (atom))); + return GPOINTER_TO_UINT (g_hash_table_lookup (display_x11->atom_from_virtual, atom)); return None; } @@ -192,8 +189,8 @@ gdk_x11_xatom_to_atom_for_display (GdkDisplay *display, display_x11 = GDK_X11_DISPLAY (display); if (display_x11->atom_to_virtual) - virtual_atom = GDK_POINTER_TO_ATOM (g_hash_table_lookup (display_x11->atom_to_virtual, - GUINT_TO_POINTER (xatom))); + virtual_atom = g_hash_table_lookup (display_x11->atom_to_virtual, + GUINT_TO_POINTER (xatom)); if (!virtual_atom) { -- 2.30.2